import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
plt.rc("figure", figsize=(12,9))
x, y = np.linspace(-2, 2, 200), np.linspace(-2, 2, 200)
X, Y = np.meshgrid(x, y)
Z = (X**2-Y**2)/(1+X**2+Y**2)
fig = plt.figure()
ax = Axes3D(fig)
ax.plot_surface(X, Y, Z)
fig = plt.figure()
ax = Axes3D(fig)
surf = ax.plot_surface(X, Y, Z, cmap=plt.cm.viridis)
fig.colorbar(surf)
ax.view_init(20, 60)
fig